package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;


@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_refund")
public class Refund implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    /**
     * 用户id
     */
    @Null(message = "请勿填写用户id")
    private Long userId;

    /**
     * 订单id
     */
    @NotNull(groups = {GroupAdd.class},message = "请填写订单id")
    //@Null(groups = {GroupUpdate.class},message ="请勿修改订单id")
    private Long orderId;

    /**
     * 订单号
     */
    @Null(groups = {GroupUpdate.class},message ="请勿修改订单编号")
    private String orderNumber;

    /**
     * 退款单号
     */
    @Null(groups = {GroupUpdate.class},message = "请勿修改退款编号")
    private String refundNumber;

    /**
     * 用户要求退款金额
     */
    private Integer requireMoneyAmount;

    /**
     * 管理员实际退款金额
     */
    private Integer actualMoneyAmount;



    /**
     * 1-待处理，2-已拒绝，3-已成功 4-微信退款处理中 5-微信退款处理失败
     */
    @NumRange(min=1,max=3,message="退款状态错误")
    private Integer status;


    /**
     * 退款申请时间
     */
    private LocalDateTime createTime;

    /**
     * 退款成功时间
     */
    @Null(message = "请勿修改退款成功时间")
    private LocalDateTime successTime;

    private String remark;


}
